﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using DTO;

namespace DAO
{
    public class HocSinhDAO
    {
        public DataTable getHocSinhs(int num)
        {
            ProviderDataContext context = new ProviderDataContext();
            var obj = from hs in context.HocSinhs
                      select hs;
            return new DataTable();
        }
        public void addHSDao(HocSinhDTO hs)
        {
            ProviderDataContext context = new ProviderDataContext();
            HocSinh entity = new HocSinh();
            entity.HoTen = hs.TenHS;
            entity.NgaySinh = hs.NgaySinh;
            entity.GioiTinh = (byte)hs.GioiTinh;
            entity.DiaChi = hs.DiaChi;
            entity.Email = hs.Email;
            entity.MaLop = hs.MaL;

            context.HocSinhs.InsertOnSubmit(entity);
            context.SubmitChanges();
        }
        
    }
}
